export default class MySprite extends godot.Node2D {
    private _texture : godot.Texture;

    get texture(){
        return this._texture
    }

    set texture(texture:godot.Texture){
        this._texture =  texture
    }

    constructor(){
        super()
    }

    // 绘制渲染回调
    _draw(): void {
        // this.textureDemo()
        // this.lineDemo()
        this.circleDemo()
    }

    // 更新渲染回调
    update(): void {
       this.textureDemo()
    }

    lineDemo(){
        this.draw_line(new godot.Vector2(200,200),new godot.Vector2(300,300),new godot.Color(1,0,0,1))
    }
    circleDemo(){
        this.draw_circle(new godot.Vector2(200,200),10,new godot.Color(1,1,1,1))
    }
    textureDemo(){
        if(this.texture){
            this.draw_texture(this._texture,this.position)
        }
    }

}